package com.example.shopdemo.utils;

import javax.servlet.http.HttpServletRequest;

/**
 * @author ：Anitaxiaofeng
 * @description：
 * @create 2018-01-20
 **/
public class CodeUtil {

    public static boolean checkVerifyCode(String verifyCodeActual, HttpServletRequest request) {
        String verifyCodeExpected = request.getSession().getAttribute("_code").toString();
        if(verifyCodeActual==null||!verifyCodeActual.equalsIgnoreCase(verifyCodeExpected)) {
            return false;
        }
        return true;
    }
}
